#include "CsvData.h"
CsvData::CsvData(){
}
CsvData::~CsvData(){
    if(outFile.is_open()){
        outFile.close();
    }
}

int CsvData::Init(const std::string &CsvPath,const std::vector<string> &value){
    // 写文件  
    outFile.open(CsvPath, ios::out); // 打开模式可省略 
    int cout = value.size();
    for( int i = 0; i < cout ; i++){
        outFile << value.at(i)<<  '\t';
    }   
    outFile<< endl;  
    return 0;
}

int CsvData::WriteData(const std::vector<string> &value){
    int cout = value.size();
    for( int i = 0; i < cout ; i++){
        outFile << value.at(i)<<  '\t';
    }
    outFile<<endl;
    return 0;
}

int CsvData::close(){
    outFile.close();
    return 0;
}
